package sparrowGui.skin
{
	import flash.display.DisplayObject;
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldType;
	
	import sparrowGui.ComboBox;
	import sparrowGui.ComponentDraw;
	import sparrowGui.item.CListItem;
	import sparrowGui.item.Item;
	
	/**
	 * 翻页按钮的皮肤,里面有下一页,上一页,跳转,当前显示页码数字按钮和文本
	 * @author Pelephone
	 */	
	public class PageSkin extends Sprite
	{
		public var btn_go:DisplayObject;
		public var btn_prev:DisplayObject;
		public var btn_next:DisplayObject;
		public var btn_last:DisplayObject;
		public var btn_first:DisplayObject;
		public var txt_inputNum:TextField;
		public var txt_showNum:TextField;
		
		public var combobox_Page:DisplayObject;
		
		public function PageSkin()
		{
			init();
		}
		
		private function init():void
		{
			var txtBG:ComponentDraw = new ComponentDraw();
			var txtBG2:ComponentDraw = new ComponentDraw();
			txtBG.width = txtBG2.width = 60;
			
			btn_first = new CListItem("首页");
			btn_prev = new CListItem("上一页");
			btn_prev.x = btn_first.x + 62;
			
			btn_next = new CListItem("下一页");
			btn_next.x = btn_prev.x + 62;
			
			btn_last = new CListItem("未页");
			btn_last.x = btn_next.x + 62;
			
			txt_inputNum = new TextField();
			txt_inputNum.restrict = "0-9";
			txt_inputNum.text = "1";
			txt_inputNum.type = TextFieldType.INPUT;
			txt_inputNum.width = 60;
			txtBG.x = txt_inputNum.x = btn_last.x + 62;
			
			btn_go = new CListItem("跳转");
			btn_go.x = txt_inputNum.x + 62;
			
			
			txt_showNum = new TextField();
			txt_showNum.width = 60;
			txtBG2.x = txt_showNum.x = btn_go.x + 62;
			
			combobox_Page = new ComboBox(null,null,CListItem);
			combobox_Page.width = 50;
			combobox_Page.x = txt_showNum.x + 62;
			
			addChild(txtBG);
			addChild(txtBG2);
			addChild(btn_next);
			addChild(btn_prev);
			addChild(btn_go);
			addChild(btn_first);
			addChild(btn_last);
			addChild(txt_inputNum);
			addChild(txt_showNum);
			addChild(combobox_Page);
			
			btn_go.name = "btn_jumppage";
			btn_prev.name = "btn_prev";
			btn_next.name = "btn_next";
			btn_last.name = "btn_last";
			btn_first.name = "btn_first";
			txt_showNum.name = "txt_showNum";
			txt_inputNum.name = "txt_inputNum";
			combobox_Page.name = "combobox_Page";
		}	
	}
}